package source

import org.apache.flink.core.fs.FileSystem
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment

/**
  * @author dinghao 
  * @create 2021-09-09 9:31 
  * @message OK
  */
object FHDFSSource {
  def main(args: Array[String]): Unit = {
    System.setProperty("HADOOP_USER_NAME","work")
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val hdfsData = env.readTextFile("hdfs://192.168.1.193:9000/dhtest")
    hdfsData.print()
    hdfsData.writeAsText("hdfs://192.168.1.193:9000/outputdhtest/",FileSystem.WriteMode.OVERWRITE)
    env.execute("hdfs-hdfs")
  }
}
